$(function () {
    layui.use(['jquery'], function () {
        let $ = layui.jquery;
        findById();
        function findById() {
            let id = sessionStorage.getItem("commentId");
            $.ajax({
                url: '/back/comment/id',
                data: {id: id},
                async: false,
                type: 'get',
                dataType: 'json',
                success: function (res) {
                    if (res.data != null) {
                        setProductData(res.data);
                    }
                }
            })

        }
        function setProductData(data) {
            console.log(data);
            $("#name").html(data.username);
            $("#appellation").html(data.appellation);
            $("#email").html(data.email);
            $("#title").html(data.title);
            $("#content").html(data.content);
        }
    });
})